package com.dingup.provider.util;

import com.dingup.api.bean.page.PageData;
import com.github.pagehelper.PageInfo;

/**
 * Created by wancheng on 2018/8/27.
 */
public class PageDataUtil {
    public static PageData getPageData(PageInfo pageInfo) {
        PageData pageData = new PageData();
        pageData.setPage(pageInfo.getPageNum());
        pageData.setRows(pageInfo.getPageSize());
        pageData.setTotal(pageInfo.getTotal());
        pageData.setData(pageInfo.getList());
        pageData.setTotalPage(pageInfo.getPages());
        return pageData;
    }
}
